import type { AxiosInstance, AxiosRequestConfig } from 'axios';
import type ApiBase from './ApiBase';
import type { IInstanceControllerGetInstanceConfig } from '@hdtd/utils';
import httpClient from '@/apis/http/http-client';
import { InstanceController } from '@hdtd/utils';
import UserApi from './UserApi';

/**
 * 获取用户信息接口
 * @param axiosInstance
 * @param config
 * @returns
 */
// export const useUserApi = (
//   key = 'default',
//   apiConfig?: AxiosRequestConfig,
//   axiosInstance?: AxiosInstance
// ) => getApiInstance(UserApi, key, apiConfig, axiosInstance);

export const useUserApi = (
  config?: IInstanceControllerGetInstanceConfig,
  apiConfig?: AxiosRequestConfig,
  axiosInstance?: AxiosInstance
) => InstanceController.getInstance(UserApi, [axiosInstance, apiConfig], config);
